<?php 
    if($template->get('notfound')!= '')
    {
        echo '<h1 style ="margin-left : 30px;">'.$template->get('notfound').'</h1>';
    }
    includeBlock('block/categoryMenuBlock');
    echo '<div style="clear:both"></div>';
    if($template->get('sIid') != '')
    {
        $aParams = array(
            'aParentCategories' => $template->get('aCatelogysname'),
            'sCurrentCategoryName' => $template->get('name'),
        );
    }     
    $aParams = array(
        'priceCondition' => $template->get('priceCondition'),
        'locations' => $template->get('locations'),
        'aManufacturers' => $template->get('aManufacturers'),
    );
    includeBlock('block/suggestionSearchBlock',$aParams);

    $aParams = array(
        'aProducts' => $template->get('alistproducts')
    );
    if($template->get('layout'))
    {
        $aParams['layout'] = $template->get('layout');
    }
    includeBlock('block/productBlock', $aParams); 
?>

<div class="metro_page_number" style="clear: both;">
    <ul>
        <?php
            $iBegin = ($template->get('page') <= 5 ? 0 : $template->get('page') - 5);
            echo '<li '.($template->get('page') == 1 ? 'class="page_disable"' : '').' ><a '.($template->get('page') > 1 ? 'href="?page='.($template->get('page')-1).'"' : '').' ><i class="fa fa-long-arrow-left"></i> Prev</a></li>';
            $i = 0;
            for($i = $iBegin; $i<= $template->get('numberPage'); $i++)
            {
                echo '<li '.($i + 1 == $template->get('page') ? 'class="page_active" ' : '').'><a href="?page='.($i + 1).'">'.($i + 1).'</a></li>';
                if($i - $iBegin == 4)
                    break;
            }
            $i +=1;
            echo '<li '.($template->get('page') >= $template->get('numberPage') ? 'class="page_disable"' : '').' ><a '.($i < $template->get('numberPage') ? 'href="?page='.($i + 1).'"' : '').'>Next <i class="fa fa-long-arrow-right"></i></a></li>';
        ?>

    </ul>
</div>